package com.example.cr.user.util;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

public class MemoryStore {
    private static final ConcurrentMap<String, String> codeStore = new ConcurrentHashMap<>();

    // 存储验证码
    public static void setCode(String key, String code) {
        codeStore.put(key, code);
    }

    // 获取验证码
    public static String getCode(String key) {
        return codeStore.get(key);
    }

    // 删除验证码
    public static void deleteCode(String key) {
        codeStore.remove(key);
    }
}